﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfApp2
{
    /// <summary>
    /// BindingTest5.xaml 的交互逻辑
    /// </summary>
    public partial class BindingTest5 : Window
    {
        public BindingTest5()
        {
            InitializeComponent();

            Student student = new Student() { Age=100, Id=1, Name="Lucy"};
            Teacher teacher=new Teacher() {  WorkYear=20};
            this.sPanel1.DataContext = student;
            this.grid1.DataContext = teacher;
            textBox1.BorderBrush = null;
        }
    }
    public class Student
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int Age { get; set; }
    }
    public class Teacher
    {
        public int WorkYear { get; set; }
    }
}
